// ****************************************************************************
// *     Filename:  TrackInfo.hh
// *  Description:  Customed track information
// *      License:  Geant4 Software License 
// *                http://geant4.cern.ch/license/LICENSE.html
// *       Author:  Tran Hoai Nam (nam at kuno-g.phys.sci.osaka-u.ac.jp)
// * Organization:  Osaka University
// *      Created:  2012-11-20 13:37:32
// ****************************************************************************
#ifndef TRACKINFO_JO2OMAX
#define TRACKINFO_JO2OMAX

#include "globals.hh"
#include "G4ThreeVector.hh"
#include "G4ParticleDefinition.hh"
#include "G4Track.hh"
#include "G4Allocator.hh"
#include "G4VUserTrackInformation.hh"

class TrackInfo : public G4VUserTrackInformation 
{
	public:
		TrackInfo();
		TrackInfo(const G4Track *aTrack);
		TrackInfo(const TrackInfo *aTrackInfo);
		~TrackInfo(){;};

		inline void *operator new (size_t);
		inline void operator delete (void *aTrackInfo);
		inline int operator ==(const TrackInfo &right) const 
		{return (this==&right);}
		void Print() const;
	private:
		G4int fpreTrackID;
		G4ParticleDefinition *fpPD;
	public:
		G4int GetPreTrackID() {return fpreTrackID;}
		G4ParticleDefinition *GetPD() {return fpPD;}

}; // end of class declaration TrackInfo 

extern G4Allocator<TrackInfo> aTrackInfoAllocator;

inline void * TrackInfo::operator new(size_t)
{
	void *aTrackInfo;
	aTrackInfo = (void*)aTrackInfoAllocator.MallocSingle();
	return aTrackInfo;
}

inline void TrackInfo::operator delete(void *aTrackInfo)
{
	aTrackInfoAllocator.FreeSingle((TrackInfo*)aTrackInfo);
}
#endif /* end of include guard: TRACKINFO_JO2OMAX */
